//
//  DetailModel.m
//  CapriceMusic
//
//  Created by 蒋恩浩 on 16/1/8.
//  Copyright © 2016年 MYX. All rights reserved.
//

#import "DetailModel.h"

@implementation DetailModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"id"]) {
        
        self.ids = value;
    }
    if ([key isEqualToString:@"relatedVideos"] || [key isEqualToString:@"videos"]) {
        
        NSArray *array = value;
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dictionary in array) {
            
            RelatedVideosModel *relatedVideos = [[RelatedVideosModel alloc] initWithDictionary:dictionary];
            [mutableArray addObject:relatedVideos];
        }
        self.relatedVideosDataSource = [NSArray arrayWithArray:mutableArray];
    }
    if ([key isEqualToString:@"artists"]) {
        
        NSArray *array = value;
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dictionary in array) {
            
            DetailDescriptionModel *description = [[DetailDescriptionModel alloc] initWithDictionary:dictionary];
            [mutableArray addObject:description];
        }
        self.artistsDataSource = [NSArray arrayWithArray:mutableArray];
    }
    if ([key isEqualToString:@"description"]) {
        
        self.descriptions = value;
    }
    if ([key isEqualToString:@"creator"]) {
        
        self.yueDanDescribeModel = [[YueDanDescribeModel alloc] initWithDictionary:value];
    }
}

@end
